package com.dubbo.provider.service;

import com.dubbo.api.CustomService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;


/**
 * @author lihongfeng
 */
@Service
public class CustomServiceImpl implements CustomService {
    private Random random = new Random();

    /**
     * 实现方法1 随机休眠100毫秒
     * @return
     * @throws InterruptedException
     */
    @Override
    public String method1() throws InterruptedException {

        Thread.sleep(random.nextInt(100));
        return "invoke method1()";
    }
    /**
     * 实现方法2 随机休眠100毫秒
     * @return
     * @throws InterruptedException
     */
    @Override
    public String method2() throws InterruptedException {
        Thread.sleep(random.nextInt(100));
        return "invoke method2()";
    }
    /**
     * 实现方法3 随机休眠100毫秒
     * @return
     * @throws InterruptedException
     */
    @Override
    public String method3() throws InterruptedException {
        Thread.sleep(random.nextInt(100));
        return "invoke method3()";
    }
}
